repo.or.cz
/
andmenj-acm.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
11137 - Ingenuous Cubrency (Programación dinámica, DP, coin change)
[andmenj-acm.git]
/
11436 - Cubes EXTREME!
/
blah.cpp
blob
3619fb5dfdf20d9e3d667c945f2999b1aa750585
1
#include <iostream>
2
#include <iterator>
3
#include <vector>
4
using namespace
std
;
5
6
typedef
unsigned long long
ull
;
7
8
int
main
(){
9
ull n
;
10
while
(
cin
>>
n
&&
n
){
11
vector
<
ull
>
d
;
12
for
(
ull i
=
1
;
i
*
i
<=
n
;
i
++) {
13
if
(
n
%
i
==
0
) {
14
d
.
push_back
(
i
);
15
if
(
i
*
i
<
n
)
d
.
push_back
(
n
/
i
);
16
}
17
}
18
sort
(
d
.
begin
(),
d
.
end
());
19
copy
(
d
.
begin
(),
d
.
end
(),
ostream_iterator
<
ull
>(
cout
,
" "
));
20
cout
<<
endl
;
21
}
22
return
0
;
23
}